package com.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author 杨冰清
 * @Date 20:52
 * @Description 订单表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Order {
    /**
     * 订单编号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("id")
    private Integer id;
    /**
     * 订单号（非主键）
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("order_no")
    private String orderNo;
    /**
     * 用户id
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("user_id")
    private Integer userId;
    /**
     * 订单总价格
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("total_price")
    private BigDecimal totalPrice;
    /**
     * 收货人姓名
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("receiver_name")
    private String receiverName;
    /**
     * 收货人手机号
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("receiver_mobile")
    private String receiverMobile;
    /**
     * 收货人地址
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("receiver_address")
    private String receiverAddress;
    /**
     * 订单状态，订单状态: 0用户已取消，10未付款（初始状态），20已付款，30已发货，40交易完成
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty("order_status")
    private Integer orderStatus;
    /**
     * 创建时间
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("create_time")
    private Date createTime;
    /**
     * 修改时间
     **/
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty("update_time")
    private Date updateTime;
    //一个订单多个订单详情
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<OrderItem> orderItems;

}
